from sklearn.datasets import load_breast_cancer
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
from sklearn.metrics import roc_auc_score


y_pred = [0, 2, 1, 3]
y_true = [0, 1, 2, 3]
print(accuracy_score(y_true, y_pred))
print(accuracy_score(y_true, y_pred, normalize=False))
print('-'*10)

X, y = load_breast_cancer(return_X_y=True)
clf = LogisticRegression(solver="liblinear", random_state=0).fit(X, y)
print(clf.predict_proba(X))
print(roc_auc_score(y, clf.predict_proba(X)[:, 1]))
print(roc_auc_score(y, clf.decision_function(X)))
print('-'*10)

X, y = load_iris(return_X_y=True)
clf = LogisticRegression(solver="liblinear").fit(X, y)
print(clf.predict_proba(X))
print(roc_auc_score(y, clf.predict_proba(X), multi_class='ovr'))
